home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / batchut / datechek.zip / DATECHEK.DOC < prev    next >
Text File  |  1988-04-24  |  2KB  |  59 lines

  1. ------------------------------------------------------------------------------
  2. Program Name...:Datecheck.COM
  3. Author.........:Rusty Brown Irving, Texas
  4. Where Found....:PC WORLD (May 1988 Issue)
  5. ------------------------------------------------------------------------------
  6.  
  7. Description:
  8.  
  9.     DATECHECK.COM is simple command file that calls DOS function 2A which 
  10.     returns the weekday as a number from 0 to 6 ie(Sunday is 0, Monday is 1,
  11.     etc...).  DATECHECK is used by calling the command from a batch file, and
  12.     then using the "IF ERRORLEVEL" batch file command to test the value.
  13.  
  14. EXAMPLE:
  15.  
  16.     echo off
  17.     datechek
  18.     if errorlevel 6 goto SAT
  19.     if errorlevel 5 goto FRI
  20.     if errorlevel 4 goto THU
  21.     if errorlevel 3 goto WED
  22.     if errorlevel 2 goto TUE
  23.     if errorlevel 1 goto MON
  24.     if errorlevel 0 goto SUN
  25.     :SUN
  26.     echo Today is Sunday
  27.     REM Insert Sunday commands
  28.     goto exit
  29.     :MON
  30.     echo Today is Monday
  31.     REM Insert Mondays commands
  32.     goto exit
  33.     :TUE
  34.     echo Today is Tuesday
  35.     REM Insert Tuesday commands
  36.     goto exit
  37.     :WED
  38.     echo Today is Wednesday
  39.     REM Insert Wednesday commands
  40.     goto exit
  41.     :THU
  42.     echo Today is Thursday
  43.     REM Insert Thursday commands
  44.     goto exit
  45.     :FRI
  46.     echo Today is Friday
  47.     REM Insert Friday commands
  48.     goto exit
  49.     :SAT
  50.     echo Today is Saturday
  51.     REM Insert Saturday commands
  52.     goto exit
  53.     :exit
  54.     
  55. NOTE: You may also take advantage of the IF NOT ERRORLEVEL batch file command
  56. to verify what day it is NOT.
  57. See Your DOS manual for further explainations in the use of IF ERRORLEVEL and
  58. GOTO batch file commands.
  59.